package com.tom.jmgd.controller;


import com.tom.jmgd.core.entity.ResultEntity;
import com.tom.jmgd.core.enums.ResultEnum;
import com.tom.jmgd.dao.TLxCallbackLogMapper;
import com.tom.jmgd.entity.param.TLxCallbackLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDateTime;


@CrossOrigin
@RestController
@RequestMapping("/dz")
public class DzController {
    @Autowired
    TLxCallbackLogMapper tLxCallbackLogMapper;


    @PostMapping("/callBack")
    public ResultEntity callBack(@RequestBody Object object) {
        TLxCallbackLog tLxCallbackLog = new TLxCallbackLog();
        tLxCallbackLog.setJsondata(object.toString());
        tLxCallbackLog.setCreatedate(LocalDateTime.now());
        tLxCallbackLog.setCompname("大众");
        tLxCallbackLogMapper.insert(tLxCallbackLog);
        return new ResultEntity(ResultEnum.SUCCESS,null);
    }


}
